[backport camel-4.14.x] CAMEL-24341: camel-google-secret-manager - fix GCP vault refresh task defects - #25340
Conversation
… defects (apache#25326) * CAMEL-24341: camel-google-secret-manager - fix GCP vault refresh task defects The GCP secret refresh task read the AWS vault configuration, so camel.vault.gcp.secrets was never honoured. It also kept triggerReloading as receiver state, so every message following a matching secret event triggered another CamelContext reload, restarted the subscriber on every period (a Google ApiService can only be started while it is NEW), and dereferenced the secretId/eventType attributes without a null check, so a message published on the subscription by anything else failed and was redelivered forever. Also aligns the javadoc of the task and of the properties function with GCP and reuses a single ObjectMapper for secret sub-key lookups. Signed-off-by: Andrea Cosentino <ancosen@gmail.com> * CAMEL-24341: address review - AssertJ and package-private test conventions Per davsclaus's non-blocking note, PubsubReloadTriggerTaskTest now uses package-private class/@test visibility and AssertJ assertions (assertThat, assertThatThrownBy, assertThatCode(...).doesNotThrowAnyException()). The interface-override methods (onReload/ack/nack) stay public since they override public API. Adds a test-scoped assertj-core dependency, not previously on the module's test classpath. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com> --------- Signed-off-by: Andrea Cosentino <ancosen@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gnodet
left a comment
There was a problem hiding this comment.
Clean cherry-pick backport to camel-4.14.x of the same fix as PR #25339 (originally PR #25326 on main). Code-level diff is identical to the main branch fix; the only adaptation is the expected pom.xml dependency name (camel-test-junit5 on 4.14.x vs camel-test-junit6 on main).
The fix correctly addresses the same four defects as described in the 4.18.x backport review — wrong vault config source, sticky reload flag, illegal ApiService restart, and null-safety for message attributes. All fixes are well-tested and verified present on the 4.14.x base branch. No API surface changes, safe for the maintenance branch. CI green.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of @gnodet
Backport of #25326 (CAMEL-24341).
The GCP vault refresh task (
PubsubReloadTriggerTask) read the AWS vault configuration (getVaultConfiguration().aws().getSecrets()) instead of the GCP one, so a GCP secret-refresh subscription watched the wrong secret list. This branch has the same defect. Cherry-picked cleanly (pom auto-merged);PubsubReloadTriggerTaskTest— 4 tests pass.Claude Code on behalf of Andrea Cosentino (@oscerd).
🤖 Generated with Claude Code